<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<title></title>
<meta name="Generator" content="Cocoa HTML Writer">
<meta name="CocoaVersion" content="949.54">
<style type="text/css">
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica}
p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px}
p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; color: #0d32ab}
p.p4 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; min-height: 12.0px}
p.p5 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; color: #000000}
p.p6 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; color: #000000; min-height: 12.0px}
p.p7 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; color: #bf0000}
p.p8 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; color: #0000bf}
p.p9 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; color: #007300}
span.s1 {font: 18.0px Helvetica}
span.s2 {text-decoration: underline}
span.s3 {text-decoration: underline ; color: #0030f2}
span.s4 {color: #0000bf}
span.s5 {color: #000000}
span.s6 {color: #007300}
span.Apple-tab-span {white-space:pre}
</style>
</head>
<body>
<p class="p1"><span class="s1"><b>AY8910</b></span><b><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>AY-3-891X Chip Sound Simulator</b></p>
<p class="p2"><br></p>
<p class="p1"><b>superclass: MultiOutUGen</b></p>
<p class="p2"><br></p>
<p class="p1">Emulation of the sound generation hardware of the AY-3-8910 chip by Ville Hallik, Michael Cuddy, Tatsuyuki Satoh, Fabrice Frances, Nicola Salmoria.</p>
<p class="p1">This was a very popular sound chip used in many arcade games and consoles (Intellivision, Vectrex) as well as in many home computers (MSX, AtariST, ZX Spectrum 128...)</p>
<p class="p3"><span class="s2">http://en.wikipedia.org/wiki/AY-3-8910</span></p>
<p class="p3"><span class="s2">http://www.atarimagazines.com/v4n7/stsound.html</span></p>
<p class="p3"><span class="s2">http://www.howell1964.freeserve.co.uk/parts/ay3891x_datasheet.htm</span></p>
<p class="p2"><br></p>
<p class="p1">Note that this ugen outputs 3 separate channels of sound!<span class="Apple-converted-space">  </span>Often you want to mix them.</p>
<p class="p1">For a simplified interface to this class see [<a href="AY8910Square.html"><span class="s3">AY8910Square</span></a>]</p>
<p class="p2"><br></p>
<p class="p1"><b><span class="Apple-tab-span">	</span>*ar(r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, rA, rB, rC, rD, rate)</b></p>
<p class="p1"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>r0 - AFINE<span class="Apple-tab-span">	</span>channel A fine frequency<span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>(8bits 0-255)</p>
<p class="p1"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>r1 - ACOARSE<span class="Apple-tab-span">	</span>channel A coarse frequency<span class="Apple-tab-span">	</span>(4bits 0-15)</p>
<p class="p1"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>r2 - BFINE<span class="Apple-tab-span">	</span>channel B fine frequency<span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>(8bits 0-255)</p>
<p class="p1"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>r3 - BCOARSE<span class="Apple-tab-span">	</span>channel B coarse frequency<span class="Apple-tab-span">	</span>(4bits 0-15)</p>
<p class="p1"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>r4 - CFINE<span class="Apple-tab-span">	</span>channel C fine frequency<span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>(8bits 0-255)</p>
<p class="p1"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>r5 - CCOARSE<span class="Apple-tab-span">	</span>channel C coarse frequency<span class="Apple-tab-span">	</span>(4bits 0-15)</p>
<p class="p1"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>r6 - NOISEPER<span class="Apple-tab-span">	</span>noise channel frequency<span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>(5bits 0-31)</p>
<p class="p1"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>r7 - ENABLE<span class="Apple-tab-span">	</span>voice enable:<span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>(5bits 0-31)</p>
<p class="p1"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>bit 5 - channel C noise</p>
<p class="p1"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>bit 4 - channel B noise</p>
<p class="p1"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>bit 3 - channel A noise</p>
<p class="p1"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>bit 2 - channel C tone</p>
<p class="p1"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>bit 1 - channel B tone</p>
<p class="p1"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>bit 0 - channel A tone</p>
<p class="p1"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>r8 - AVOL<span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>channel A volume &amp; env:<span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>(5bits 0-31)</p>
<p class="p1"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>bit 4 - envelope enable</p>
<p class="p1"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>bits 0-3 - volume</p>
<p class="p1"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>r9 - BVOL<span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>channel B volume &amp; env:<span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>(5bits 0-31)</p>
<p class="p1"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>bit 4 - envelope enable</p>
<p class="p1"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>bits 0-3 - volume</p>
<p class="p1"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>rA - CVOL<span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>channel C volume &amp; env:<span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>(5bits 0-31)</p>
<p class="p1"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>bit 4 - envelope enable</p>
<p class="p1"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>bits 0-3 - volume</p>
<p class="p1"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>rB - EFINE<span class="Apple-tab-span">	</span>envelope fine period<span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>(8bits 0-255)</p>
<p class="p1"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>rC - ECOARSE<span class="Apple-tab-span">	</span>envelope coarse period<span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>(8bits 0-255)</p>
<p class="p1"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>rD - ESHAPE<span class="Apple-tab-span">	</span>envelope shape:<span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>(4bits 0-15)</p>
<p class="p1"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>bit 3 - continue</p>
<p class="p1"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>bit 2 - attack</p>
<p class="p1"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>bit 1 - alternate</p>
<p class="p1"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>bit 0 - hold</p>
<p class="p1"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>rate - scale playbackrate for the 3 tones (float 0.0-...)</p>
<p class="p4"><br></p>
<p class="p5">s.boot;</p>
<p class="p6"><br></p>
<p class="p7">//one voice</p>
<p class="p5">{<span class="s4">AY8910</span>.ar(r0:50, r1:0, r7:2r00001000, r8:13)}.play</p>
<p class="p5">{<span class="s4">AY8910</span>.ar(r0:50, r1:1, r7:2r00001000, r8:13)}.play</p>
<p class="p6"><br></p>
<p class="p7">//two voices</p>
<p class="p5">{<span class="s4">AY8910</span>.ar(r0:50, r1:0, r2:75, r3:0, r7:2r00011000, r8:13, r9:13)}.play</p>
<p class="p6"><br></p>
<p class="p7">//three voices.<span class="Apple-converted-space">  </span>to listen to all three in a stereo output you'll need to mix</p>
<p class="p5">{<span class="s4">Mix</span>(<span class="s4">AY8910</span>.ar(r0:50, r1:0, r2:75, r3:0, r4:90, r5:0, r7:2r00111000, r8:13, r9:13, rA:13))*0.5}.play</p>
<p class="p6"><br></p>
<p class="p7">//noise only on first voice + mouse xy countrol</p>
<p class="p5">{<span class="s4">AY8910</span>.ar(r0:100, r1:0, r6:<span class="s4">MouseY</span>.kr(0, 31), r7:2r00000001, r8:<span class="s4">MouseX</span>.kr(0, 15))}.play</p>
<p class="p6"><br></p>
<p class="p7">//looping envelope on voice first voice</p>
<p class="p5">{<span class="s4">AY8910</span>.ar(r0:100, r1:0, r6:15, r7:2r00001000, r8:31, rB:<span class="s4">MouseX</span>.kr(0, 255), rC:1, rD:2r1010)}.play</p>
<p class="p5">{<span class="s4">AY8910</span>.ar(r0:100, r1:0, r6:15, r7:2r00001001, r8:31, rB:<span class="s4">MouseX</span>.kr(0, 255), rC:1, rD:2r1010)}.play</p>
<p class="p5">{<span class="s4">AY8910</span>.ar(r0:100, r1:0, r6:15, r7:2r00000001, r8:31, rB:<span class="s4">MouseX</span>.kr(0, 255), rC:1, rD:2r1010)}.play</p>
<p class="p6"><br></p>
<p class="p7">//different envelope</p>
<p class="p5">{<span class="s4">AY8910</span>.ar(r0:100, r1:0, r6:15, r7:2r00000001, r8:31, rB:0, rC:20, rD:2r0001)}.play</p>
<p class="p6"><br></p>
<p class="p7">//the rate argument</p>
<p class="p5">{<span class="s4">AY8910</span>.ar(r0:<span class="s4">Line</span>.kr(0, 127, 0.15), r1:<span class="s4">Line</span>.kr(0, 0, 0.15), r7:2r00001000, r8:15, rate:1)}.play</p>
<p class="p5">{<span class="s4">AY8910</span>.ar(r0:<span class="s4">Line</span>.kr(0, 127, 0.15), r1:<span class="s4">Line</span>.kr(0, 0, 0.15), r7:2r00001000, r8:15, rate:2)}.play</p>
<p class="p5">{<span class="s4">AY8910</span>.ar(r0:<span class="s4">Line</span>.kr(0, 127, 0.15), r1:<span class="s4">Line</span>.kr(0, 0, 0.15), r7:2r00001000, r8:15, rate:1.5)}.play</p>
<p class="p5">{<span class="s4">AY8910</span>.ar(r0:<span class="s4">Line</span>.kr(0, 127, 0.15), r1:<span class="s4">Line</span>.kr(0, 0, 0.15), r7:2r00001000, r8:15, rate:<span class="s4">MouseX</span>.kr(0, 10))}.play</p>
<p class="p6"><br></p>
<p class="p6"><br></p>
<p class="p7">//misuse</p>
<p class="p5">{<span class="s4">AY8910</span>.ar(r0:<span class="s4">SinOsc</span>.kr(<span class="s4">SinOsc</span>.kr(0.2), 0, 10, 10), r1:0, r2:<span class="s4">SinOsc</span>.kr(<span class="s4">SinOsc</span>.kr(0.15), 0, 10, 10), r3:0, r7:2r00011000, r8:12, r9:12)}.play</p>
<p class="p6"><br></p>
<p class="p5">{<span class="s4">AY8910</span>.ar(r0:<span class="s4">SinOsc</span>.kr(0.25)&lt;0.8*<span class="s4">SinOsc</span>.kr(0.2, 0, 25, 25), r1:<span class="s4">SinOsc</span>.kr(4, <span class="s4">SinOsc</span>.kr(1))&gt;0.3, r2:20, r3:<span class="s4">SinOsc</span>.kr(12)&gt;<span class="s4">SinOsc</span>.kr(0.2, 0, 0.5, 1), r7:2r00011000, r8:13, r9:<span class="s4">SinOsc</span>.kr(0.1, 0, 6, 6).max(0))}.play</p>
<p class="p6"><br></p>
<p class="p5">{<span class="s4">Pan2</span>.ar(<span class="s4">Mix</span>(<span class="s4">AY8910</span>.ar(r0:50+<span class="s4">SinOsc</span>.kr(14, 0, 12), r1:0, r2:60+<span class="s4">SinOsc</span>.kr(8, 0, 14), r3:0, r4:70+<span class="s4">SinOsc</span>.kr(10, 0, 16), r5:2, r7:2r00111000, r8:31, r9:31, rA:31, rB:<span class="s4">SinOsc</span>.kr(0.1, 0, 127.5, 127.5), rC:2, rD:2r1010))*0.6)}.play</p>
<p class="p6"><br></p>
<p class="p5">{<span class="s4">Pan2</span>.ar(<span class="s4">Mix</span>(<span class="s4">AY8910</span>.ar(r0:<span class="s4">SinOsc</span>.kr(0.11)&gt;0.9*10+5, r1:0, r2:<span class="s4">SinOsc</span>.kr(0.12)&gt;0.9*2+20, r3:0, r4:<span class="s4">SinOsc</span>.kr(0.13)&gt;0.9*25+25, r5:<span class="s4">SinOsc</span>.kr(14)&gt;0.9, r7:2r00111000, r8:31, r9:31, rA:31, rB:0, rC:<span class="s4">SinOsc</span>.kr(<span class="s4">Lag</span>.kr(<span class="s4">SinOsc</span>.kr(0.1)&gt;0.9*4+1, 3), 0, <span class="s4">LFTri</span>.kr(0.1, 0, 4, 4), 4), rD:2r1110))*0.6)}.play</p>
<p class="p6"><br></p>
<p class="p6"><br></p>
<p class="p5">(</p>
<p class="p8">SynthDef<span class="s5">(</span><span class="s6">\ay8910</span><span class="s5">, {</span>|out= 0, gate= 1, r0= 0, r1= 0, r2= 0, r3= 0, r4= 0, r5= 0, r6= 0, r7= 0, r8= 0, r9= 0, rA= 0, rB= 0, rC= 0, rD= 0, rate= 1, amp= 1, pan= 0|</p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s4">var</span> e, z;</p>
<p class="p5"><span class="Apple-tab-span">	</span>e= <span class="s4">EnvGen</span>.kr(<span class="s4">Env</span>.asr(0.01, amp, 0.05), gate, doneAction:2);</p>
<p class="p5"><span class="Apple-tab-span">	</span>z= <span class="s4">Mix</span>(<span class="s4">AY8910</span>.ar(r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, rA, rB, rC, rD, rate));</p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s4">Out</span>.ar(out, <span class="s4">Pan2</span>.ar(z*e, pan));</p>
<p class="p5">}).add;</p>
<p class="p5">)</p>
<p class="p6"><br></p>
<p class="p5">(</p>
<p class="p8">Pbind<span class="s5">(</span></p>
<p class="p9"><span class="s5"><span class="Apple-tab-span">	</span></span>\instrument<span class="s5">, </span>\ay8910<span class="s5">,</span></p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\dur</span>, 0.125,</p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\amp</span>, 0.3,</p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\r0</span>, <span class="s4">Pseq</span>([<span class="s4">Pn</span>(3, 64), <span class="s4">Pn</span>(32, 54), <span class="s4">Pn</span>(10, 10)], <span class="s4">inf</span>),</p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\r1</span>, <span class="s4">Pseq</span>([<span class="s4">Pn</span>(1, 32), <span class="s4">Pwhite</span>(0, 3, 12)], <span class="s4">inf</span>),</p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\r2</span>, <span class="s4">Pseq</span>([<span class="s4">Pn</span>(3, 17), <span class="s4">Pn</span>(<span class="s4">Prand</span>([10, 20, 30]), 4), <span class="s4">Pn</span>(10, 3)], <span class="s4">inf</span>),</p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\r3</span>, <span class="s4">Pseq</span>([1, 2, <span class="s4">Pwrand</span>([3, 2, 1, 0], [0.1, 0.2, 0.3, 0.4])], <span class="s4">inf</span>),</p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\r6</span>, <span class="s4">Pseq</span>([<span class="s4">Pseq</span>([10, 20, <span class="s4">Pwrand</span>([100, 110], [0.7, 0.3]), 50], 15), <span class="s4">Pn</span>(3, 4)], <span class="s4">inf</span>),</p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\r7</span>, 2r00011100,</p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\r8</span>, 15,</p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\r9</span>, 15,</p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\rA</span>, 31,</p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\rB</span>, 10,</p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\rC</span>, <span class="s4">Pseq</span>([<span class="s4">Pseq</span>([1, 0], 24), <span class="s4">Pseq</span>([1, 0, 2], 8)], <span class="s4">inf</span>),</p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\rD</span>, 2r0000</p>
<p class="p5">).play</p>
<p class="p5">)</p>
<p class="p6"><br></p>
<p class="p5">(</p>
<p class="p8">Pbind<span class="s5">(</span></p>
<p class="p9"><span class="s5"><span class="Apple-tab-span">	</span></span>\instrument<span class="s5">, </span>\ay8910<span class="s5">,</span></p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\dur</span>, <span class="s4">Pbrown</span>(0.1, 0.15, 0.1),</p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\amp</span>, 0.8,</p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\r0</span>, <span class="s4">Pseq</span>([100, 130, 160], <span class="s4">inf</span>)*<span class="s4">Pseq</span>([<span class="s4">Pn</span>(1, 32), <span class="s4">Pn</span>(0.75, 32)], <span class="s4">inf</span>),</p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\r1</span>, 0,</p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\r2</span>, <span class="s4">Pseq</span>([24, 24, <span class="s4">Pwrand</span>([20, 23], [0.6, 0.4])], <span class="s4">inf</span>),</p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\r3</span>, <span class="s4">Pseq</span>([0, 2, <span class="s4">Pwrand</span>([1, 0], [0.6, 0.4])], <span class="s4">inf</span>),</p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\r7</span>, 2r00011100,</p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\r8</span>, 10,</p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\r9</span>, 31,</p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\rA</span>, 31,</p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\rB</span>, 10,</p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\rC</span>, <span class="s4">Pseq</span>([<span class="s4">Pseq</span>([1, 0], 24), <span class="s4">Pseq</span>([1, 0, 2], 8)], <span class="s4">inf</span>),</p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\rD</span>, 2r0000</p>
<p class="p5">).play</p>
<p class="p5">)</p>
<p class="p6"><br></p>
<p class="p5">(</p>
<p class="p8">Pbind<span class="s5">(</span></p>
<p class="p9"><span class="s5"><span class="Apple-tab-span">	</span></span>\instrument<span class="s5">, </span>\ay8910<span class="s5">,</span></p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\dur</span>, <span class="s4">Pseq</span>([0.06, 0.04], <span class="s4">inf</span>),</p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\amp</span>, 0.8,</p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\r7</span>, 2r00101111,</p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\r8</span>, 31,</p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\r9</span>, <span class="s4">Pseq</span>([<span class="s4">Pn</span>(31, 48), <span class="s4">Pn</span>(13, 48)], <span class="s4">inf</span>),</p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\rA</span>, 31,</p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\rB</span>, <span class="s4">Pseq</span>([1, 3, <span class="s4">Pwrand</span>([2, 1], [0.6, 0.4])], <span class="s4">inf</span>),</p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\rC</span>, <span class="s4">Pseq</span>([<span class="s4">Pn</span>(1, 8), <span class="s4">Pn</span>(2, 12), <span class="s4">Pn</span>(1, 16), <span class="s4">Pn</span>(<span class="s4">Pwrand</span>([0, 40], [0.8, 0.2]), 12)], <span class="s4">inf</span>),</p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\rD</span>, 2r0000</p>
<p class="p5">).play</p>
<p class="p5">)</p>
<p class="p6"><br></p>
<p class="p5">(</p>
<p class="p8">Pbind<span class="s5">(</span></p>
<p class="p9"><span class="s5"><span class="Apple-tab-span">	</span></span>\instrument<span class="s5">, </span>\ay8910<span class="s5">,</span></p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\dur</span>, <span class="s4">Pseq</span>([0.025, 0.025, 0.025, 0.045], <span class="s4">inf</span>),</p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\amp</span>, 0.8,</p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\r7</span>, 2r00101111,</p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\r8</span>, <span class="s4">Pseq</span>([<span class="s4">Pn</span>(31, 128), <span class="s4">Pn</span>(13, 128)], <span class="s4">inf</span>),</p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\r9</span>, <span class="s4">Pseq</span>([<span class="s4">Pn</span>(31, 48), <span class="s4">Pn</span>(13, 48)], <span class="s4">inf</span>),</p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\rA</span>, <span class="s4">Pseq</span>([<span class="s4">Pn</span>(31, 16), <span class="s4">Pn</span>(13, 16)], <span class="s4">inf</span>),</p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\rB</span>, <span class="s4">Pseq</span>([1, 3, 2], <span class="s4">inf</span>),</p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\rC</span>, <span class="s4">Pseq</span>([<span class="s4">Pn</span>(1, 8), <span class="s4">Pn</span>(2, 12), <span class="s4">Pn</span>(1, 16), <span class="s4">Pn</span>(40, 40)], <span class="s4">inf</span>),</p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\rD</span>, 2r0000</p>
<p class="p5">).play</p>
<p class="p5">)</p>
<p class="p6"><br></p>
<p class="p5">(</p>
<p class="p8">Pbind<span class="s5">(</span></p>
<p class="p9"><span class="s5"><span class="Apple-tab-span">	</span></span>\instrument<span class="s5">, </span>\ay8910<span class="s5">,</span></p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\dur</span>, 0.1,</p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\amp</span>, 0.8,</p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\r0</span>, <span class="s4">Pseq</span>([<span class="s4">Pseq</span>([10, 2], 32), <span class="s4">Pseq</span>([1, 9], 32), <span class="s4">Pseq</span>([1, 2, 4], 36)], <span class="s4">inf</span>),</p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\r1</span>, <span class="s4">Pseq</span>([<span class="s4">Pseries</span>(0, 14, 16), <span class="s4">Pseries</span>(10, 5, 16)], <span class="s4">inf</span>),</p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\r2</span>, <span class="s4">Pseq</span>([<span class="s4">Pseries</span>(0, 31, 16), <span class="s4">Pseries</span>(27, 31, 16)], <span class="s4">inf</span>),</p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\r3</span>, <span class="s4">Pseq</span>([<span class="s4">Pseries</span>(0, 31, 16), <span class="s4">Pseries</span>(26, 31, 16)], <span class="s4">inf</span>),</p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\r4</span>, <span class="s4">Pseq</span>([2, 3, 3, 2], <span class="s4">inf</span>),</p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\r5</span>, 0,</p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\r6</span>, <span class="s4">Pseq</span>([<span class="s4">Pseries</span>(0, 2, 120)], <span class="s4">inf</span>),</p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\r7</span>, 2r00111000,</p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\r8</span>, 12,</p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\r9</span>, 31,</p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\rA</span>, 31,</p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\rB</span>, 10,</p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\rC</span>, <span class="s4">Pseq</span>([<span class="s4">Pseq</span>([1, 0, 1, 4], 24), <span class="s4">Pseq</span>([1, 1, 4], 8)], <span class="s4">inf</span>),</p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\rD</span>, 2r0000</p>
<p class="p5">).play</p>
<p class="p5">)</p>
<p class="p6"><br></p>
<p class="p5">(</p>
<p class="p8">Pbind<span class="s5">(</span></p>
<p class="p9"><span class="s5"><span class="Apple-tab-span">	</span></span>\instrument<span class="s5">, </span>\ay8910<span class="s5">,</span></p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\dur</span>, 0.1,</p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\amp</span>, 0.8,</p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\legato</span>, 1.5,<span class="Apple-tab-span">	</span></p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\r0</span>, <span class="s4">Pseq</span>([<span class="s4">Pn</span>(2, 80), <span class="s4">Pn</span>(3, 80), <span class="s4">Pn</span>(4, 80), <span class="s4">Pn</span>(0, 40)], <span class="s4">inf</span>),</p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\r1</span>, <span class="s4">Pseq</span>([<span class="s4">Pseries</span>(0, 0.01, 10)], <span class="s4">inf</span>),</p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\r2</span>, <span class="s4">Pseq</span>([<span class="s4">Pseries</span>(5, 0.1, 40)], <span class="s4">inf</span>),</p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\r3</span>, <span class="s4">Pseq</span>([<span class="s4">Pseries</span>(10, 0.05, 50)], <span class="s4">inf</span>),</p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\r4</span>, 10,</p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\r5</span>, 0,</p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\r6</span>, <span class="s4">Pseq</span>([<span class="s4">Pseries</span>(0, 2, 120)], <span class="s4">inf</span>),</p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\r7</span>, 2r00111000,</p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\r8</span>, 31,</p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\r9</span>, 31,</p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\rA</span>, 31,</p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\rB</span>, <span class="s4">Pseq</span>([<span class="s4">Pseries</span>(10, 1, 100)], <span class="s4">inf</span>),</p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\rC</span>, <span class="s4">Pseq</span>([<span class="s4">Pseq</span>([1, 0, 1, 4], 24), <span class="s4">Pseq</span>([1, 1, 4], 8)], <span class="s4">inf</span>),</p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\rD</span>, 2r0000,</p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\rate</span>, <span class="s4">Pseq</span>([<span class="s4">Pseries</span>(1, 1, 20)], <span class="s4">inf</span>)</p>
<p class="p5">).play</p>
<p class="p5">)</p>
<p class="p6"><br></p>
<p class="p5">(</p>
<p class="p8">Pbind<span class="s5">(</span></p>
<p class="p9"><span class="s5"><span class="Apple-tab-span">	</span></span>\instrument<span class="s5">, </span>\ay8910<span class="s5">,</span></p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\dur</span>, 0.1,</p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\amp</span>, 0.8,</p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\legato</span>, 1.2,</p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\r0</span>, <span class="s4">Pseq</span>([<span class="s4">Pn</span>(3, 40), <span class="s4">Pwhite</span>(3, 10, 8)], <span class="s4">inf</span>),</p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\r1</span>, 0,</p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\r7</span>, 2r00001000,</p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\r8</span>, 14,</p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="s6">\rate</span>, <span class="s4">Pseq</span>([<span class="s4">Pn</span>(1, 8), <span class="s4">Pn</span>(2, 8), <span class="s4">Pn</span>(1, 8), <span class="s4">Pn</span>(<span class="s4">Pwrand</span>([1.1, 1.5], [0.8, 0.2]), 8)], <span class="s4">inf</span>)*<span class="s4">Pseq</span>([<span class="s4">Pn</span>(1, 64), <span class="s4">Pn</span>(20, 64)], <span class="s4">inf</span>)</p>
<p class="p5">).play</p>
<p class="p5">)</p>
</body>
</html>
